﻿<UserControl x:Class="Esponce.Views.TrackStatisticsView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:m="clr-namespace:Esponce.Models"
	xmlns:v="clr-namespace:Esponce.Views"
	xmlns:control="clr-namespace:LoadingControl.Control"
  mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="400">
	<UserControl.DataContext>
		<m:TrackStatisticsViewModel />
	</UserControl.DataContext>
	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="10" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>

		<!-- Input parameters -->
		<TextBlock Grid.Row="0" Text="EXPORT STATISTICS" Style="{StaticResource TitleStyle}" />

		<Border Grid.Row="2" Style="{StaticResource BorderStyle}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>

				<Grid Grid.Row="0" Margin="20">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="75" />
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<TextBlock Text="QR Code id:" Grid.Column="0" VerticalAlignment="Center" Style="{StaticResource LabelStyle}" />
					<TextBox Grid.Column="1" Text="{Binding QRCodeId, Mode=TwoWay}" Margin="0,0,0,0" VerticalContentAlignment="Center" />

					<!--<TextBlock Grid.Column="1" Text="Format:" Style="{StaticResource LabelStyle}" Margin="0,2,0,2" />-->
					<ComboBox Grid.Column="2" SelectedIndex="{Binding FormatIndex, Mode=TwoWay}" Width="90" Margin="10,0,10,0">
						<ComboBoxItem Content="CSV" />
						<ComboBoxItem Content="XLS" />
						<ComboBoxItem Content="XML" />
						<ComboBoxItem Content="JSON" />
					</ComboBox>
					<Button Grid.Column="3" Content="Export" Padding="7,0,7,2" Click="btnExport_Click" FontWeight="Bold" />

				</Grid>

				<Grid Grid.Row="1" Margin="20,0,20,20">
					<!-- Loading animation -->
					<control:LoadingAnimation HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" IsLoading="{Binding IsLoading}" Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}" />
				</Grid>
			</Grid>
		</Border>

	</Grid>
</UserControl>
